export default {
  imgs:{
    hand:require('./assets/imgs/hand.png'),
    musicPlay:require('./assets/imgs/icon-music-play.png'),
    musicPause:require('./assets/imgs/icon-music-close.png'),
    result:require('./assets/imgs/total-line-bg.png'),
    resultIcon: require('./assets/imgs/total-line-icon.png'),
    userHead:require('./assets/logo.png'),
  },
  appSchema:'http://www.hzbank.com.cn/mobile/wallet.html',
  BrowserInfo:{
    versions: function () {
      var u = navigator.userAgent,
        app = navigator.appVersion;
      return {
        trident: u.indexOf('Trident') > -1, //IE内核
        presto: u.indexOf('Presto') > -1, //opera内核 webKit:
        gecko: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核 gecko:
        firefox: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
        mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
        ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
        android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
        iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
        iPad: u.indexOf('iPad') > -1, //是否iPad webApp:
        //u.indexOf('Safari') == -1, //是否web应该程序，没有头部与底部
        weixin: u.indexOf('MicroMessenger') > -1, //是否微信 （2015-01-22新增）
        qq: u.match(/\sQQ/i) == " qq" //是否QQ
      };
    }(),
    language: (navigator.browserLanguage || navigator.language).toLowerCase()
  },
  wxConfig:{ //wx8fc20b3cc2f7bba8     wx34f0c9c5c44af4b5
    appid:'wx34f0c9c5c44af4b5'
  },
  appConfig:[
    {
      name: 'production',
      appid: 'wx8fc20b3cc2f7bba8',
      apiHost: 'http://192.168.1.86:8222/',
      otherApi: ''
    },
    {
      name:'dev',
      appid:'wx8fc20b3cc2f7bba8',
      apiHost:'http://temporary.birdjia.com/bird_dsp/act/',
      otherApi:'/bird_dsp'
    },
    {
      name:'production',
      appid:'wx34f0c9c5c44af4b5',
      apiHost:'https://actserver.birdpush.com/',
      otherApi:''
    },
    {
      name: 'pvuv',
      appid: 'wx34f0c9c5c44af4b5',
      apiHost: 'https://birdpush.com/',
      otherApi: ''
    }
  ],
  config:function(){
    return this.appConfig[2]
  },
  configPvUv: function () {
    return this.appConfig[3]
  },
  getQueries: function (urlStr) {
    // 获取 URL 参数的值,并支持utf-8解码
    // 返回一个对象
    urlStr = urlStr || window.location.href
    if (urlStr.indexOf('?') == -1) {
      console.error('url无过滤参数')
      return {}
    }
    let str = urlStr.split('?')[1]  //获取url中"?"符后的字串
    if (str.substr(str.length - 1, 1) == '&') { //对最后一项如果多余& 截取
      str = str.substr(0, str.length - 1)
    }
    let theRequest = new Object();
    if (str.indexOf("?") == -1) {
      var strs = str.split("&");
      for (var i = 0; i < strs.length; i++) {
        theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
      }
    }
    console.log(`获取参数键值对: `, theRequest)
    return theRequest
  },
  MobDevice: function() {
    // 判断移动端类型
    if (/Android/i.test(navigator.userAgent.toLowerCase())) {
      return 0
    } else if (/iPhone/i.test(navigator.userAgent.toLowerCase())) {
      return 1
    } else {
      return 2
    }
  }
}